.TH ST-FLASH 1 "Sep 2016" "Open Source STMicroelectronics Stlink Tools" "STLINK"
.SH NAME
.PP
st-flash - Flash binary files to STM32 device
.SH SYNOPSIS
.PP
\f[I]st-flash\f[] [\f[I]OPTIONS\f[]] {read|write|erase} [\f[I]FILE\f[]]
<ADDR> <SIZE>
.SH DESCRIPTION
.PP
Flash binary files to arbitrary sections of memory, or read arbitrary
addresses of memory out to a binary file.
.PP
You can use this instead of st-util(1) if you prefer, but remember to
use the \f[B]\&.bin\f[] image, rather than the \f[B]\&.elf\f[] file.
.PP
Use hexadecimal format for the \f[I]ADDR\f[] and \f[I]SIZE\f[].
.SH COMMANDS
.TP
.B write \f[I]FILE\f[] \f[I]ADDR\f[]
Write firmware \f[I]FILE\f[] to device starting from \f[I]ADDR\f[]
.RS
.RE
.TP
.B read \f[I]FILE\f[] \f[I]ADDR\f[] \f[I]SIZE\f[]
Read firmware from device starting from \f[I]ADDR\f[] up to
\f[I]SIZE\f[] bytes to \f[I]FILE\f[]
.RS
.RE
.TP
.B erase
Perform a mass erasing of the device firmware
.RS
.RE
.SH OPTIONS
.TP
.B --version
Print version information
.RS
.RE
.TP
.B --debug
TODO
.RS
.RE
.TP
.B --reset
TODO
.RS
.RE
.TP
.B --serial \f[I]iSerial\f[]
TODO
.RS
.RE
.TP
.B --flash=\f[I]size\f[]
Override the device's normal flash size, where size is the flash size in bytes. 
It can be specified in decimal, octal or hexadecimal.
The size argument can optionally be followed by 'k' for KB or 'm' for MB.
Examples --flash=128k or --flash=0x080k.
.RS
.RE
.SH EXAMPLES
.PP
Flash \f[C]firmware.bin\f[] to device
.IP
.nf
\f[C]
$\ st-flash\ write\ firmware.bin\ 0x8000000
\f[]
.fi
.PP
Read firmware from device (4096 bytes)
.IP
.nf
\f[C]
$\ st-flash\ read\ firmware.bin\ 0x8000000\ 4096
\f[]
.fi
.PP
Erase firmware from device
.IP
.nf
\f[C]
$\ st-flash\ erase
\f[]
.fi
.SH SEE ALSO
.PP
st-util(1), st-info(1), st-term(1)
.SH COPYRIGHT
.PP
This work is copyrighted.
Stlink contributors.
See \f[I]LICENSE\f[] file in the stlink source distribution.
